import Vue from 'vue'
import Router from 'vue-router'
import Index from './views'
const Login = () => import(/* webpackChunkName: "login" */ '@/views/login/Login')
const RechargeRecord = () => import(/* webpackChunkName: "rechargeRecord" */ '@/views/rechargeRecord')
const OrderManage = () => import(/* webpackChunkName: "orderManage" */ '@/views/orderManage')
const OrderList = () => import(/* webpackChunkName: "orderManage" */ '@/views/orderManage/OrderList')
const OrderCount = () => import(/* webpackChunkName: "orderManage" */ '@/views/orderManage/OrderCount')
const AgencyManage = () => import(/* webpackChunkName: "agencyManage" */ '@/views/agencyManage')
const ResManage = () => import(/* webpackChunkName: "resManage" */ '@/views/resManage')
const ReportManage = () => import(/* webpackChunkName: "reportManage" */ '@/views/reportManage')
const MemberManage = () => import(/* webpackChunkName: "memberManage" */ '@/views/memberManage')
const DrawManage = () => import(/* webpackChunkName: "drawManage" */ '@/views/drawManage')
const DepositManage = () => import(/* webpackChunkName: "depositManage" */ '@/views/depositManage')
const NoticeManage = () => import(/* webpackChunkName: "noticeManage" */ '@/views/noticeManage')
const ActivityCenter = () => import(/* webpackChunkName: "activityCenter" */ '@/views/activityCenter')
const VersionManage = () => import(/* webpackChunkName: "versionManage" */ '@/views/versionManage')

Vue.use(Router)

const router = new Router({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index,
      redirect: 'rechargeRecord',
      children: [
        { name: '充值管理', path: 'rechargeRecord', component: RechargeRecord },
        {
          name: '订单管理',
          path: 'orderManage',
          component: OrderManage,
          redirect: 'orderManage/orderList',
          children: [
            { path: 'orderList', name: '订单列表', component: OrderList },
            { path: 'orderCount', name: '订单统计', component: OrderCount }
          ]
        },
        { name: '代理管理', path: 'agencyManage', component: AgencyManage },
        { name: '赛果管理', path: 'resManage', component: ResManage },
        { name: '报表管理', path: 'reportManage', component: ReportManage },
        { name: '会员管理', path: 'memberManage', component: MemberManage },
        { name: '提款管理', path: 'drawManage', component: DrawManage },
        { name: '存款管理', path: 'depositManage', component: DepositManage },
        { name: '公告管理', path: 'noticeManage', component: NoticeManage },
        { name: '活动中心', path: 'activityCenter', component: ActivityCenter },
        { name: 'APP版本管理', path: 'versionManage', component: VersionManage }
      ]
    },
    { path: '/login', name: '登录', component: Login }
  ]
})
export default router
